<template>
  <div id="recruitTable">
    <div>
        <!-- <el-button icon="el-icon-download" type="primary" style="float:right" @click="exportAll">导出</el-button> -->
      <h1 style="text-align:center">全部单位岗位数量汇总表</h1>
      <div style="margin-bottom:10px">
        <!-- 单位：
        <el-select v-model="editForm.unitType">
          <el-option :value="1" label="自然资源部不动产登记中心（自然资源部法律事务中心）" />
          <el-option :value="2" label="自然资源部不动产登记中心下属研究所" />
        </el-select> -->
      </div>
      <el-table :data="list" highlight-current-row v-loading="listLoading" style="width: 100%;margin-bottom: 20px;">
        <el-table-column prop="unitName" label="单位" min-width="50" />
        <el-table-column prop="allCount" label="岗位总量" width="50" align="center" />
        <el-table-column label="管理岗位" align="center">
          <el-table-column prop="managePost3Count" width="50" label="三级" align="center" />
          <el-table-column prop="managePost4Count" width="50" label="四级" align="center" />
          <el-table-column prop="managePost5Count" width="50" label="五级" align="center" />
          <el-table-column prop="managePost6Count" width="50" label="六级" align="center" />
          <el-table-column prop="managePost7Count" width="50" label="七级" align="center" />
          <el-table-column prop="managePost8Count" width="50" label="八级" align="center" />
          <el-table-column prop="managePost9Count" width="50" label="九级" align="center" />
          <el-table-column prop="managePost10Count" width="50" label="十级" align="center" />
          <el-table-column prop="managePostCount" width="50" label="合计" align="center" />
        </el-table-column>
        <el-table-column label="专业技术岗位" align="center">
          <el-table-column width="100" label="高级" align="center">
            <el-table-column prop="techPost1Count" width="50" label="一级" align="center" />
            <el-table-column prop="techPost2Count" width="50" label="二级" align="center" />
            <el-table-column prop="techPost3Count" width="50" label="三级" align="center" />
            <el-table-column prop="techPost4Count" width="50" label="四级" align="center" />
            <el-table-column prop="techPost5Count" width="50" label="五级" align="center" />
            <el-table-column prop="techPost6Count" width="50" label="六级" align="center" />
            <el-table-column prop="techPost7Count" width="50" label="七级" align="center" />
            <el-table-column prop="techPostHCount" width="50" label="小计" align="center" />
          </el-table-column>
          <el-table-column prop="techPostMCount" width="50" label="中级" align="center">
          </el-table-column>
          <el-table-column prop="techPostLCount" width="50" label="初级" align="center">
          </el-table-column>
          <el-table-column prop="techPostCount" width="50" label="合计" align="center" />
        </el-table-column>
        <el-table-column label="工勤岗位" align="center">
          <el-table-column width="100" label="技术工" align="center">
            <el-table-column prop="work1Count" width="50" label="一级" align="center" />
            <el-table-column prop="work2Count" width="50" label="二级" align="center" />
            <el-table-column prop="work3Count" width="50" label="三级" align="center" />
            <el-table-column prop="work4Count" width="50" label="四级" align="center" />
            <el-table-column prop="work5Count" width="50" label="五级" align="center" />
          </el-table-column>
          <el-table-column prop="work0Count" width="50" label="普通工" align="center" />
          <el-table-column prop="workCount" width="50" label="合计" align="center" />
        </el-table-column>
      </el-table>
      <!-- <el-table :data="list1" highlight-current-row v-loading="listLoading" style="width: 100%;margin-bottom: 20px;" :span-method="objectOneMethod">
        <el-table-column prop="postType" label="岗位类型" min-width="100" />
        <el-table-column prop="level" label="项目" width="100" />
        <el-table-column prop="sum" label="合计" width="80" />
        <el-table-column label="学历" align="center">
          <el-table-column prop="postNum1" width="100" label="研究生" align="center" />
          <el-table-column prop="postNum1" width="100" label="大学本科" align="center" />
          <el-table-column prop="postNum1" width="100" label="大学专科" align="center" />
          <el-table-column prop="postNum1" width="100" label="中专" align="center" />
          <el-table-column prop="postNum1" width="100" label="高中及以下" align="center" />
        </el-table-column>
        <el-table-column label="学位" align="center">
          <el-table-column prop="postNum2" width="100" label="博士" align="center" />
          <el-table-column prop="postNum2" width="100" label="硕士" align="center" />
          <el-table-column prop="postNum2" width="100" label="学士" align="center" />
        </el-table-column>
        <el-table-column label="年龄" align="center">
          <el-table-column prop="postNum3" width="100" label="35岁及以下" align="center" />
          <el-table-column prop="postNum3" width="100" label="36岁至40岁" align="center" />
          <el-table-column prop="postNum3" width="100" label="41岁至45岁" align="center" />
          <el-table-column prop="postNum3" width="100" label="46岁至50岁" align="center" />
          <el-table-column prop="postNum3" width="100" label="51岁至54岁" align="center" />
          <el-table-column prop="postNum3" width="100" label="55岁至59岁" align="center" />
          <el-table-column prop="postNum3" width="100" label="60岁及以上" align="center" />
        </el-table-column>
      </el-table> -->
    </div>
    <!-- <div v-else style="padding:20px; font-size:14px;color:#999;text-align:center">暂无数据</div> -->
  </div>
</template>
<script>
export default {
  props: {
    timestamp: ''
  },
  data () {
    return {
      list: [],
      listLoading: false
    }
  },
  watch: {
    timestamp (val) {
      this.loaddata()
    }
  },
  methods: {
    exportAll (filename, filepathname) {
      window.open(this.$http.defaults.baseURL + this.$http.defaults.postAPI + 'api/shenghuohui/getfujian?unitId=' + this.$route.params.id + '&filepathname=' + filepathname + '&t=' + new Date())
    },
    loaddata () {
      this.listLoading = true
      this.$http
        .get(this.$http.defaults.postAPI + `api/cadrePostBusPostPerson/getStatList`)
        .then(response => {
          this.listLoading = false
          if (response.data.success === true) {
            this.list = response.data.result
          } else {
            console.log('获取失败:' + response.data.message)
            this.$message({
              message: '获取失败:' + response.data.message,
              type: 'error'
            })
          }
        })
        .catch(error => {
          this.listLoading = false
          this.$message({
            message: '获取失败:' + error,
            type: 'error'
          })
        })
    }
  }
}
</script>
<style scoped>
  .mytable{
    border-top: 1px solid #74a6cc;
    border-left: 1px solid #74a6cc;
    margin:0 10px 10px;
    width: calc(100% - 20px);
  }
  .mytable th{
    padding: 10px;
    border-right: 1px solid #74a6cc;
    border-bottom: 1px solid #74a6cc;
    vertical-align: top;
    line-height: 150%;
    background: #FAFAFA;
    width:200px;
    text-align:right;
  }
  .mytable td{
    padding: 10px;
    border-right: 1px solid #74a6cc;
    border-bottom: 1px solid #74a6cc;
    vertical-align: top;
    line-height: 150%;
  }
</style>
<style>
#recruitTable .el-table{
  border:1px solid #95B8E7 !important;
}
#recruitTable .el-table td, #recruitTable .el-table th{
  border-right:1px solid #95B8E7 !important;
  border-bottom:1px solid #95B8E7 !important;
}
</style>
